<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script>
        function Parent(){
            this.x=100;//c.x=100
            this.y=200;//c.y=200
            this.run=function(){//c.run=函数
                console.log(1);
            }
        }


        //将Child看成是构造函数
        function Child(){
            this.w=1000;
            this.h=2000;

            //通过call或者apply实现了继承
            Parent.call(this);//将来通过new Child()出来的对象,去调用Parent函数

        }
        var c=new Child();
        console.log(c);
    </script>
</head>
<body>
    
</body>
</html>